export default function (req, res) {
    const storeCount = 5; // Number of mock stores to generate
  
    const generateMockStore = (index) => {
      const storeId = 20000 + index;
      const unitPrice = [50, 80, 100, 120, 150][Math.floor(Math.random() * 5)];
  
      return {
        id: storeId,
        name: `线上直属校区${index + 1}`,
        classtimeUnitPrice: unitPrice,
        unusedClasstime: parseFloat((Math.random() * 500 + 50).toFixed(1)),
        unusedStoreCoin: parseFloat((Math.random() * 1000 + 100).toFixed(2)),
      };
    };
  
    const mockData = Array.from({ length: storeCount }, (_, i) => generateMockStore(i));
  
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
            "code": 0,
            "message": "成功！",
            "data": [ 
                {
                    "id": 20000,
                    "name": "--线上直属校区1",
                    "classtimeUnitPrice": 85, 
                    "unusedClasstime":1,
                    "unusedStoreCoin": 261.18
                },
                {
                    "id": 20001,
                    "name": "线上直属校区2",
                    "classtimeUnitPrice": 80,
                    "unusedClasstime": 2,
                    "unusedStoreCoin": 487.22
                },
                {
                    "id": 20002,
                    "name": "线上直属校区3",
                    "classtimeUnitPrice": 150,
                    "unusedClasstime": 3,
                    "unusedStoreCoin": 656.74
                },
                {
                    "id": 20003,
                    "name": "线上直属校区4",
                    "classtimeUnitPrice": 100,
                    "unusedClasstime": 4,
                    "unusedStoreCoin": 1063.16
                },
                {
                    "id": 20004,
                    "name": "线上直属校区5",
                    "classtimeUnitPrice": 50,
                    "unusedClasstime": 432.2,
                    "unusedStoreCoin": 176.92
                }
            ],
            "timestamp": 1762254570601,
            "requestId": "requestId_g1zk6rj5mo9",
            "signature": "signature_g0ba85hze4",
            "isMock": true
        });
      }, 100);
    });
  }